Repository navigation
fix(scenarios): each card persona's role states the writes its build prompt did not - #33707
Merged
Merged
Conversation
…t did not Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibxF3yXjruc2fxomWA5
Contributor
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs. What this run could not see
Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
Contributor
Author
|
epic:#33595#1 · os-tesla · session_01L9qiby1cctpVpRbJzjccvY 席位核对 · ACCEPT · PR #33707 (#33597 round 2) · 2026-11-15T07:11ZHead-sha:
|
This was referenced Nov 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Tesla · project thread
Clause-②: no
Metadata-protocol: none
Fixes #33597
维护者速读
role文字补上了它要做或被禁止做的写操作(对象 + 动词),另加一个测试:每张卡的每个写操作都必须在该卡的构建 prompt 里写明。run.personas[].role和测试,不动 schema、runner、prompt 代码;角色文字也会出现在运行时的“You act for …”里,所以这几个角色的运行 prompt 会变。回滚即 revert。test/score/scenario-cards.test.ts末尾的 TRACE 表(40 个写操作各自的出处),以及下方前后对照表。pnpm --filter @objectstack/scenarios exec vitest run test/score/scenario-cards.test.ts(21 项全绿)。What changes
The rule (done-when 2 of #33597, verbatim): 「The build prompt states nothing new: the grants already trace to the prompt through the data contract (
docs/qa/scenarios/README.md"Build checks trace to the prompt"); if a grant does not, the card is fixed instead.」 The library's owner (eval#1, 05:52Z) ruled the carrier: each persona'srolestring, naming the object and the verbs; no new card field, no schema, runner or prompt change. The seat ruled the scope: a write need is untraced only when the card's whole rendered build prompt (buildPrompt) never states it for that persona; fix those and name them.Re-derived over every card.
personaGrantNeedsover the nine cards ofdocs/qa/scenarios/gives 40 write needs (32 needed, 8 refusedPERMISSION_DENIED). Each was read against its card's rendered build prompt. 21 are stated by the card's prose; 19 were not, and their persona's role now states them.The seat's list (seat record 6889635350) named the first seven rows' needs. The re-derivation adds six personas' needs on starter cards, each one the prose does not state for that persona:
The 21 needs the prose states, with the passages, are the
TRACEStable in the test, for example order_to_cash sales_rep sales_order update refused ← "a rep cannot approve their own order" and travel_expense finance_officer expense_claim update ← "once Finance approves, Finance pays it".The pin (
packages/qa/scenarios/test/score/scenario-cards.test.ts, section 3 TRACE). It maps every write need of the library to where its build prompt states it:ROLEentries: the persona's role, judged by a plain text rule. The role must name the object (its machine name with_read as a space, plural allowed) and a verb word for that verb class. A refused write also needs a negation ("may not", "but not", "cannot", "never"). The test also checks that the role is rendered in the prompt's persona line.A new write need with no entry, an entry for a need that no longer exists, a role that stops naming its write, or a quoted passage edited out of the prose: each is a red. Limits are stated in the test. The rule reads words, not grammar: it does not check that the verb word governs the object, or which object a negation applies to. A prose trace is a reviewer's reading, pinned so it cannot silently stop being true. The verb word lists are the verbs the library's roles use; a new one is added in the open.
Run prompts move too.
rolealso renders in each operation's run prompt ("You act for ",prompts.ts). The 13 edited personas' run prompts change, on all seven cards touched. The recorded fixturetest/runner/fixtures/eval-r1-build-denial.recording.jsonreplays by its replay key (card/mode/half/operation/persona), not by prompt text, so it needed no re-pin, and its suite passes unchanged.Files. Seven card JSONs,
run.personas[].roleonly (asset_lifecycle,crm_account_with_contacts,invoice_with_line_items,leave_balances,project_with_tasks,service_desk,travel_expense), with no title,zh/enor other prose touched. Plustest/score/scenario-cards.test.ts(the pin) andtest/runner/units.test.ts(one pinned prompt line carrying the sdr role). The cards ship in the package'sdist/library(scripts/pack-library.mjs;files[]holdsdist), so there is a patch changeset. Nosrc/**, schema, runner or prompt code changes.Verification
Head
7702fe40, one commit onorigin/main36936440(which holds #33630).pnpm --filter @objectstack/scenarios buildexit 0, thenpnpm --filter @objectstack/scenarios test: 32 files, 763 passed (packed-tarball.test.tsreads the rebuiltdist/librarybyte for byte).tsc --noEmitexit 0. Root eslint (--no-inline-config) on the two touched test files exit 0.node scripts/ablation-replace.mjs, each restored to the HEAD blob withgit diff HEADempty:service_desk.json): 1 red;leave_balanceshr_officer entry deleted from the table: 2 red.dispatch-gates --commandslisted 61; each ran with</dev/null.check:cross-package-test-inputsfirst exited 1: the pin listeddocs/qa/scenarios/with its ownreaddirSync, a read no declared glob covers. It now loads the library through the package'sloadScenarios, astest/library.test.tsdoes, and the gate re-ran exit 0. All 61:: exit 0; the--ranreconciliation is 61 derived, 61 run, 0 NOT-MEASURED, 0 UNRUN. Changed lines: 165 (+149 / -16, 10 files).Acceptance notes
🤖 Generated with Claude Code
https://claude.ai/code/session_01L9qibxF3yXjruc2fxomWA5